package org.dromara.community.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.dromara.community.entity.AsSponsor;
import org.dromara.community.entity.dto.AsSponsorDTO;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Mapper
public interface AsSponsorMapper extends BaseMapper<AsSponsor> {


    @Select("\tselect\n" +
        "\t\tsa.id,\n" +
        "\t\tsa.user_id,\n" +
        "\t\tsu.nick_name,\n" +
        "\t\tsa.activity_id,\n" +
        "\t\tact.activity_name\n" +
        "  from\n" +
        "\t as_sponsor sa\n" +
        "\t LEFT JOIN  sys_user su on sa.user_id = su.user_id\n" +
        "\t left join  as_activity act on act.id = sa.activity_id")
    List<AsSponsorDTO> selectAsSponsorAll();

}
